package com.yh.exception;


import com.yh.common.Warning;
import lombok.Data;

/**
 * 自定义异常(BaseException)
 * @author yh
 * @date 2020/05/08
 */
@Data
public class BaseException extends RuntimeException {

    private Integer code;

    private String message;

    public BaseException(Warning exceptionType) {
        this.code = exceptionType.getValue();
        this.message = exceptionType.getName();
    }

    public BaseException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

}
